# -*- coding:utf-8 -*-

"""
定期产品

"""
from aw import *
from autotest import *


class Test_001(TestCase):
    def setUp(self):
        print("Test_001 setUp")
        Common.selectProduct("PD201809261944590653017")
        Common.dumpProduct("ZC201809261708180352826")
        Common.loadProduct("ZC201809261708180352826")
        # common.selectProduct("PD201808141531538370881")

        # common.updateProduct("ZC201810111720364643399", product_name="现金分期4444")

        # Common.createProduct("ZC201810111720364643399", product_name="现金分期4444")
        Common.cleanCache(1100111023)
        Common.clearRisk(1100111023)

    def test(self):
        print("Test_001 test")
        Common.getRecordProduct(product_type=2)
        Common.login()


        Common.updateProduct("PD201810251609042264758",product_term=45)
        Common.updateProduct("PD201809261944590653017",public_time="2018-09-26 19:44:59")
        Common.updateProduct("PD201809261944590653017",raise_start_time="2018-09-26 19:45:59")
        Common.updateProduct("PD201809261944590653017",min_tendered_sum=8000)
        Common.updateProduct("PD201809261944590653017",remain_sum=1555001)
        Common.updateProduct("PD201809261944590653017",remain_sum=1000000)

        # 定期加息
        Common.updateProduct("PD201809261944590653017", subsidy_rate=0.0200,annual_rate = 0.0900)


    def tearDown(self):
        print("Test_001 tearDown")
